package com.sky.mapper;

import com.sky.annotion.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetMealDishMapper {


    List<Long> getSetMealIDByDishId(List<Long> ids);

    @AutoFill(OperationType.INSERT)
    void insert(List<SetmealDish> setmealDishes);

    void deleteBySetMealIds(List<Long> setMealIds);

    @Select("select * from setmeal_dish where setmeal_id = #{setMealId}")
    List<SetmealDish> getDishesBySetMealId(Long setMealId);

    @Delete("delete from setmeal_dish where setmeal_id = #{setMealId}")
    void deleteBySetMealId(Long setMaelId);
}
